home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13446 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: rover.ucs.ualberta.ca!gpu3!hcolquho
  2. From: hcolquho@gpu3.srv.ualberta.ca (Harry Colquhoun)
  3. Newsgroups: comp.lang.c
  4. Subject: malloc question
  5. Date: 6 Apr 1996 23:08:07 GMT
  6. Organization: University of Alberta, Edmonton, Canada
  7. Message-ID: <4k6tgn$13c8@pulp.ucs.ualberta.ca>
  8. NNTP-Posting-Host: gpu3.srv.ualberta.ca
  9. X-Newsreader: NN version 6.5.0 (NOV)
  10.  
  11. Not quite sure what's happening here, most likely something real stupid I 
  12. did, I'm sure.
  13.  
  14. compiled using djgpp under MSDOS->works fine
  15. compiled using djgpp on SGI->core dump 
  16.  
  17. -------------------------
  18. global variable 'frames'
  19.  
  20. the problem:
  21.  
  22. unsigned long int *mem;
  23. mem = (unsigned long int *) malloc (frames);
  24. -------------------------
  25.  
  26. changing to 'unsigned long int mem[100]' and no malloc fixes problem
  27.  
  28.  
  29. Anyone know why?
  30.  
  31. Harry.
  32. (email me please)
  33.  
  34. --
  35. ------------------------------------------------------------------------------
  36. DEEP THOUGHTS: "If trees could scream, would you still cut them down?...
  37.         Well, you would if they screamed all the time."
  38. ------------------------------------------------------------------------------
  39.